package main

import "fmt"

/*
* Author: JacksonCoder
* CreateTime: 2024/12/1
 */

type Fish struct {
	Name string
}

func (f Fish) Swim() {
	println("fish 在游")
}

// 衍生类型
type FakeFish Fish

func UseFish() {
	f1 := Fish{}
	f1.Swim()
	f2 := FakeFish(f1)
	f2.Name = "tom"
	//f2.Swim()  // fakeFish 没有swim方法
	println(f1.Name)
	fmt.Printf("f1 name: %v\n", f1.Name)
	// var y yu
	var y Yu
	y.Name = "jack"
	y.Swim()
}

// type MyTime time.Time
//func ( m MyTime) MyFunc(){
//
//}

// 向后兼容
type Yu = Fish
